package services.solDistWS;

public class SolDistWSProxy implements SolDistWS {

	private String _endpoint = null;
	private SolDistWS recibirSolDistWS = null;

	public SolDistWSProxy() {
		_initSolDistProxy();
	}

	public SolDistWSProxy(String endpoint) {
		_endpoint = endpoint;
		_initSolDistProxy();
	}

	private void _initSolDistProxy() {
		try {
			recibirSolDistWS = (new SolDistWSServiceLocator()).getSolDistWSPort();
			if (recibirSolDistWS != null) {
				if (_endpoint != null)
					((javax.xml.rpc.Stub)recibirSolDistWS)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
				else
					_endpoint = (String)((javax.xml.rpc.Stub)recibirSolDistWS)._getProperty("javax.xml.rpc.service.endpoint.address");
			}

		}
		catch (javax.xml.rpc.ServiceException serviceException) {
			System.out.println("\n\n EXPLOTO EN: _initSolDistProxy de SolDistWSProxy \n\n");
			
		}
	}

	public String getEndpoint() {
		return _endpoint;
	}

	public void setEndpoint(String endpoint) {
		_endpoint = endpoint;
		if (recibirSolDistWS != null)
			((javax.xml.rpc.Stub)recibirSolDistWS)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);

	}

	public SolDistWS getRecibirSolDistWS() {
		if (recibirSolDistWS == null)
			_initSolDistProxy();
		return recibirSolDistWS;
	}

	public boolean recibirSolDist(java.lang.String xmlSolDist) throws java.rmi.RemoteException{
		if (recibirSolDistWS == null)
			_initSolDistProxy();
		return recibirSolDistWS.recibirSolDist(xmlSolDist);
	}


}